


<!DOCTYPE html>
<html>

<head>

    <block name="seo">
        <title>首页111 {$site_info.site_name|default=''}</title>
        <meta name="keywords" content="{$site_info.site_seo_keywords|default=''}" />
        <meta name="description" content="{$site_info.site_seo_description|default=''}">
    </block>

    <style type="text/css">
        .table-hover>tbody>tr:hover {
            background-color: cadetblue !important;
        }
    </style>
</head>

<body>
    <div style="height: 50px;"></div>


                <div id="login_container"></div>





    <script src="https://res.wx.qq.com/connect/zh_CN/htmledition/js/wxLogin.js"></script>

    <script>
        var wxlogin1 = new WxLogin({
            self_redirect: true,
            id: "login_container",
            appid: "wx8a4c076bdc1594f8",
            scope: "snsapi_login",
            redirect_uri: "https://f.kjdll.cn:9999//plugin/xiongyi/wechat1/callback2025",//"https://dhgx.kjdll.cn/WxLoginCallBack",
            state: "STATE#wechat_redirect",
            style: "black",
            href: "1",
            onReady: function (isReady) {
                console.log(isReady);
            }
        });
        function login() {
            $("#msg-loginstatus").html("");
            var username = $("#inputUserName").val();
            var password = $("#inputPassword").val();
            //console.log("用户名：" + username + "，密码：" + password);
            $.ajax({
                type: "POST",
                dataType: "json",
                url: '/login',
                cache: false,
                //data: JSON.stringify({id: userid}),         //ajax delete时，需要将json对象转换成json字符串发送
                data: {
                    inputUserName: username,
                    inputPassword: password
                },
                success: function (res) {
                    console.log("success 返回数据");
                    console.log(res); //返回的是JSON数据
                    if (res.code == 1) {
                        window.location.href = "/";
                    } else {
                        $("#msg-loginstatus").html("<strong style='color:red;'>" + res.msg + "</strong>");
                    }
                },
                complete: function (xhr, res) {
                    console.log("complete 返回数据");
                    console.log(res); //返回的是JSON数据
                    //获取服务端自定义的header信息
                    let stoken = xhr.getResponseHeader('Authorization');
                    //console.log(stoken);
                    localStorage.setItem("token", stoken);//保存token到localstorage
                    //sessionStorage.setItem("token", stoken);//保存token到sessionstorage
                }
            });
        }
    </script>


</body>

</html>